package com.richrail.state;

import java.util.List;

public class TrainState implements UnitState
{
	private String name;
	
	private List<WagonState> wagons;
	
	public TrainState(String name, List<WagonState> wagons)
	{
		this.name = name;
		this.wagons = wagons;
	}

	@Override
	public String getName()
	{
		return name;
	}

	public List<WagonState> getWagons()
	{
		return wagons;
	}
	
	@Override
	public int getSeatCount()
	{
		int count = 0;
		
		for (WagonState wagon: wagons)
		{
			count += wagon.getSeatCount();
		}
		
		return count;
	}
}
